import java.util.Collection;
import java.util.ArrayList;

/** Represents an interface for nodes.
    @author Ian Helmke, Dan King
*/
interface INode<NI, LI> {
  /** Gets underlying information about this node. This could be a string
      representing the name of the node, an integer representing it's number,
      or a class with compound data.
      @return The information embedded within this node.
  */
  public NI getInfo();

  /** Gets an interable of all the links of this node.
      @return An iterable of all the links originating at this node.
  */
  public Iterable<ILink<LI, NI>> getLinks();

  /**
   * Gets the link at the given index
   * @param int the index
   * @return ILink<LI, NI> the link at the given index
   **/
  public ILink<LI, NI>getLink(int index);

  /** Adds the given link to this node.
      @param newLink The link to be added.
  */
  public void addLink(ILink<LI, NI> newLink);

  /** Clears all the the neighbor links this node has */
  public void clearNeighbors();

  /**
   * Determines if this node is connected to that node.
   * @param Node the destination node
   * @return boolean true if this node is connected to that node
   **/
  public boolean isConnectedTo(INode<NI, LI> that);

  /**
   * Determines if this node is connected to that node.
   * @param Node the destination node
   * @param seen the nodes that have already been visited
   * @return boolean true if this node is connected to that node
   **/
  public boolean isConnectedTo(INode<NI, LI> that, ArrayList<INode<NI, LI>> seen);
}
